package com.newway.back.mapper.approval;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.newway.back.dto.approval.response.ApplyListDto;
import com.newway.back.entity.approval.ApprovalInstance;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface ApprovalInstanceMapper extends BaseMapper<ApprovalInstance> {

    @Select(" select ai.title,at2.template_name,ai.created_at applyTime,ai.current_status from approval_instances ai inner join approval_templates at2 on ai.template_id =at2.template_id\n" +
            "where ai.instance_id =#{id} order by ai.created_at desc ")
    List<ApplyListDto> getMyApplyList(@Param("id") Integer id);
}
